import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant'
import 'vant/lib/index.css'
// import 'amfe-flexible'
import 'normalize.css'
import '@/styles/comm.css'
// 处理路由bug
import Router from 'vue-router'

// 全局注册GeekIcon  1:导入  2：注册
// import GeekIcon from '@/components/geek-icon.vue'
// Vue.component(GeekIcon.name,GeekIcon )
// Vue.use(js代码)
// 如果js暴露的是个function，该function会直接执行
// export default function (Vue, options) {}
// 执行Vue.use

import componentJs from '@/components/index.js'
// Vue.use(componentJs, 123)
// 导入过滤器
import filtersObj from '@/filters/index.js'
// 全局过滤器注册
Object.keys(filtersObj).forEach(item => {
  Vue.filter(item, filtersObj[item])
})
Vue.use(componentJs)
Vue.use(Vant)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
// 处理路由小bug
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
